#include<iostream>
using namespace std;
class A
{
public:
	A();
	~A();
	void SetData(int year, int month, int day);
	int _year;
	int _month;
	int _day;
	static int sum;
private:
};
int A::sum = 100;//初始化静态变量，它属于类但是不属于类的对象,为所有对象所共享
A::A()
{
	sum += 8;
}
A::~A()
{
}
class B
{
public:
	B();
	~B();
	A *m_a;	
private:
};
B::B()
{
}
B::~B()
{
}
B bb;
void A::SetData(int year, int month, int day)
{
	
	_year = year;
	_month = month;
	_day = day;
	bb.m_a = this;
}
int  main()
{
	A a;
	int mm=a.sum;
	a.SetData(212,321,132);
 
	int a1 = bb.m_a->_day;
 
	a.SetData(21, 32, 13);
	int a2 = bb.m_a->_day;
	A aa;
 
	aa.SetData(32342,34243,2424243);
	int a3 = bb.m_a->_year;
	cout << a1 << " " << a2 << " " << a3 << endl;
	getchar();
}